home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 September / Amiga Games Extra CD-ROM 9-1996.iso / userbox / publicdomain / dunderdir / sources / wildchange.asm < prev    next >
Assembly Source File  |  1996-04-30  |  2KB  |  105 lines

  1. ******
  2. **
  3. ** This source is Public Domain. Do what you want
  4. ** with it. But you may not change it and keep it
  5. ** with the DunderDir archive :(
  6. **
  7. ** This was assembled with ASM-One but should
  8. ** work with almost any assembler :)
  9. **
  10. ******
  11. **
  12. ** Exec offsets
  13. **
  14. _LVOOldOpenLibrary    = -408
  15. _LVOCloseLibrary    = -414
  16. ********
  17. **
  18. ** DOS offsets
  19. _LVOPutStr        = -948
  20. ********
  21. **
  22. ** Some stuff in _DOSBase
  23. dl_Root        = 34
  24. rn_Flags    = 52
  25. RNB_WILDSTAR    = 24
  26. ********
  27. **
  28. _AbsExecBase    = 4
  29. **
  30. ********
  31. ** Made these macros because i'm so lazy :)
  32. **
  33. jsrb        MACRO
  34.         jsr    _LVO\1(a6)
  35.         ENDM
  36.  
  37. Print        MACRO
  38.         lea    \1(pc),a0
  39.         move.l    a0,d1
  40.         jsrb    PutStr
  41.         ENDM
  42.  
  43. *** Start
  44.  
  45.         movea.l    a0,a2        * Save argument
  46.  
  47.         lea    dosname(pc),a1
  48.         movea.l    _AbsExecBase.w,a6
  49.         jsrb    OldOpenLibrary
  50.         movea.l    d0,a6
  51.         bne.s    gotdos
  52.         moveq    #20,d0        * failure
  53.         rts
  54.  
  55. gotdos:        Print    hellotxt
  56.         cmpi.b    #'?',(a2)    * print args?
  57.         bne.s    noshow
  58.         Print    argstxt
  59.         bra.s    exit
  60.  
  61. noshow:        movea.l    dl_Root(a6),a3
  62.         cmpi.b    #'-',(a2)+
  63.         bne.s    toggle
  64.         ori.b    #$20,(a2)    * make letter small
  65.  
  66.         cmpi.b    #'o',(a2)    * set?
  67.         bne.s    not_o
  68. wason:        Print    ontxt
  69.         bset    #RNB_WILDSTAR,rn_Flags(a3)
  70.         bra.s    exit
  71.  
  72. not_o:        cmpi.b    #'f',(a2)    * unset?
  73.         bne.s    toggle
  74. wasoff:        Print    offtxt
  75.         bclr    #RNB_WILDSTAR,rn_Flags(a3)
  76.         bra.s    exit
  77.  
  78. toggle:        bchg    #RNB_WILDSTAR,rn_Flags(a3)
  79.         btst    #RNB_WILDSTAR,rn_Flags(a3)
  80.         beq.s    wasoff
  81.         bra.s    wason
  82.  
  83. exit:        movea.l    _AbsExecBase.w,a1
  84.         exg.l    a1,a6
  85.         jsrb    CloseLibrary
  86.         moveq    #0,d0        * return ok.
  87.         rts            * exit
  88.  
  89.     dc.b    '$VER: WildChange 1.00 (13-May-95)',0
  90. dosname:    dc.b    'dos.library',0
  91. hellotxt:    dc.b    'WildChange © 1995 Jimmie Matsson, '
  92.         dc.b    'All Rights Reserved.',$a
  93.         dc.b    'Not for commersial usage.',$a,$a,0
  94. argstxt:    dc.b    'Usage: WildChange [-o | -f | -t]',$a,$a
  95.         dc.b    '        -o  Turn wildstar on',$a
  96.         dc.b    '        -f  Turn wildstar off',$a
  97.         dc.b    '        -t  Toggle wildstar',$a,$a
  98.         dc.b    'Options are case-insensitive. '
  99.         dc.b    'Default option is -t(Toggle).',$a
  100.         dc.b    'If the option is unknown, then -t(Toggle) '
  101.         dc.b    'will be used.',$a,$a,0
  102. ontxt:        dc.b    'WildStar is ON',$a,0
  103. offtxt:        dc.b    'WildStar is OFF',$a,0
  104.  
  105.